/* ----------------------------------------------------------------------------
* File: event_handler.h
*
* Desc: Implementation of event handler for Quiz Skype
*
* Created: 01/07/2011, by Alexey Korshunov
* ---------------------------------------------------------------------------- */
#ifndef _EVENT_HANDLER_IMPL_H_
#define _EVENT_HANDLER_IMPL_H_

#include <memory>

#include "api_event_dispatcher.h"
#include "exception.h"
#include "quiz_module.h"
#include "quiz_common.h"
#include "utils.h"

namespace QuizCore
{
	struct EventHandlerParams
	{
		EventHandlerParams()
			: Queue(NULL)
		{
		}

		Common::Utils::ConcurrentQueue<MsgInfo>* Queue;
	};

	class EventHandlerImpl 
		: public SkypeProtection::APIEventHandler
	{
	public:
		explicit EventHandlerImpl(const EventHandlerParams& params)
			throw(Common::Exception);

		virtual void OnCommand(SKYPE4COMLib::ICommand* pCommand);
		virtual void OnReply(SKYPE4COMLib::ICommand* pCommand);
		virtual void OnError(SKYPE4COMLib::ICommand* pCommand, LONG Number, BSTR Description);
		virtual void OnAttachmentStatus(SKYPE4COMLib::TAttachmentStatus Status);
		virtual void OnConnectionStatus(SKYPE4COMLib::TConnectionStatus Status);
		virtual void OnUserStatus(SKYPE4COMLib::TUserStatus Status);
		virtual void OnOnlineStatus(SKYPE4COMLib::IUser* pUser, SKYPE4COMLib::TOnlineStatus Status);
		virtual void OnCallStatus(SKYPE4COMLib::ICall* pCall, SKYPE4COMLib::TCallStatus Status);
		virtual void OnCallHistory();
		virtual void OnMute(VARIANT_BOOL Status);
		virtual void OnMessageStatus(SKYPE4COMLib::IChatMessage* pMessage, SKYPE4COMLib::TChatMessageStatus Status);
		virtual void OnMessageHistory(BSTR Username);

	private:
		Common::Utils::ConcurrentQueue<MsgInfo>* m_Queue;
	};
}

#endif // _EVENT_HANDLER_IMPL_H_